﻿// =============================================================================
// TNTTools AttributeInfoObjectInfo.cs
// Copyright (c) 2013 TNTTechnologies Inc.
// =============================================================================

#region

using System;
using System.Reflection;

using TNTTools.Reflection.Interfaces;
using TNTTools.Serialization.Interfaces;

#endregion

namespace TNTTools.Reflection{
    /// <summary>
    ///     This will change the type used inside ObjectInfo.
    ///     In this case, we will process things differently for class markup attributes.
    ///     An example how to overwrite the writing of XML to support attributes such as [XMLIgnore]
    /// </summary>
    internal class AttributeInfoObjectInfo : ObjectInfo{
        public AttributeInfoObjectInfo(
            Type sourceType, object source, ISimpleSerializer serializer, IBasicTypes basicTypes)
            : base(sourceType, source, serializer, basicTypes){
        }

        public override ReflectiveProperty CreatePropertyType(
            PropertyInfo propertyInfo,
            bool isList,
            Attributes classMarkUpAttributesXml,
            GetterMethod getter,
            SetterMethod setter){
            return new AttributeInfoReflectiveProperty(propertyInfo, isList, classMarkUpAttributesXml, getter, setter);
        }
    }
}